<template>
  <div class="station-pop" @click="closeDialog">
    <div class="station-pop-title">{{title}}</div>
    <div class="station-pop-content">
      <div class="station-pop-content-item" v-if="stationPopData.kyzmc">
        <span class="point"></span>
        <div class="content">客运站：{{stationPopData.kyzmc}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.address">
        <span class="point"></span>
        <div class="content">地址：{{stationPopData.address}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.carCount">
        <span class="point"></span>
        <div class="content">运营车辆：{{stationPopData.carCount}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.todayCount">
        <span class="point"></span>
        <div class="content">今日客流：{{stationPopData.todayCount}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.destination">
        <span class="point"></span>
        <div class="content">到达站：{{stationPopData.destination}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.arrive">
        <span class="point"></span>
        <div class="content">即将到达：{{stationPopData.arrive}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.monitor">
        <span class="point"></span>
        <div class="let-title">车站监控：</div>
        <div class="right-content">
          <div class="right-content-item" v-for="(item, index) in stationPopData.monitor" :key="index">
            {{item}}<img class="item-icon" src="@/assets/images/situational-awareness/jiankong.png">
          </div>
        </div>
      </div>
      <!-- 旅客详情 -->
      <div class="station-pop-content-item" v-if="stationPopData.realName">
        <span class="point"></span>
        <div class="content">姓名：{{stationPopData.realName}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.idCard">
        <span class="point"></span>
        <div class="content">身份证号：{{stationPopData.idCard}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.buyTime">
        <span class="point"></span>
        <div class="content">购票时间：{{stationPopData.buyTime}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.departureStation">
        <span class="point"></span>
        <div class="content">始发站：{{stationPopData.departureStation}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.terminus">
        <span class="point"></span>
        <div class="content">终点站：{{stationPopData.terminus}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.company">
        <span class="point"></span>
        <div class="content">客运公司：{{stationPopData.company}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.vehicle">
        <span class="point"></span>
        <div class="content">车辆：{{stationPopData.vehicle}}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop, Emit } from 'vue-property-decorator'
@Component({
  name: 'station-pop'
})
export default class StationPop extends Vue {
  @Prop({
    default: () => {
      return {
        station: '贵州汽车站',
        address: '贵州市156号',
        carCount: '560辆',
        todayCount: '63501人',
        destination: '桂林、北海、玉林',
        arrive: '桂A96851、桂A21352、桂A21352、桂A21352',
        monitor: ['出站口监控1', '人脸识别监控2']
      }
    }
  })
  private stationPopData!: any

  @Prop({ default: '客运站详情' }) private title!: string

  @Emit('close')
  closeDialog () {
    console.log('emit close')
  }

  created() {
    console.log(this.stationPopData, this.title)
  }
}
</script>

<style lang="scss" scoped>
.station-pop {
  box-sizing: border-box;
  width: 294px;
  height: auto;
  border-radius: 8px;
  background: rgba(1, 19, 67, 0.6);
  padding: 22px 20px 20px 20px;
  text-align: left;
  font-family: 'PingFang Regular';
  box-shadow: 0px 3px 20px 3px rgba(3, 125, 220, 0.7);
  &-title {
    font-size: 20px;
    font-weight: bold;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  &-content {
    margin-top: 20px;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    font-family: 'PingFang Regular';
    &-item {
      display: flex;
      box-sizing: border-box;
      width: 100%;
      margin-bottom: 6px;
      .point {
        display: inline-block;
        min-width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #0c81fe;
        margin-top: 7px;
        margin-right: 5px;
      }
      .right-content {
        &-item {
          display: flex;
          align-items: center;
          .item-icon {
            margin-left: 5px;
            width: 16px;
            height: 16px;
          }
        }
      }
    }
  }
}
</style>
